Technote DV 13 | June 1990 |
You may get the idea when implementing device drivers that _PBClose is
superfluous. After all, if you have a resident driver for a NuBus(TM) video
board, the only time your driver is not needed is if the operating system is
going away. It might seem that nothing important can happen after the
operating system goes away, so why bother with _PBClose? Well, it
turns out a lot can happen, and this Note tells you why it is important to
implement a Close (_PBClose) routine.
The problem with your driver not being needed when the operating system is going away is that there is more than one way for the operating system to go away. Besides the user choosing Restart or Shutdown from the Special menu, it is possible for the Macintosh operating system to be transformed into an entirely new operating system. This is exactly what happens when A/UX starts.
The A/UX Startup application (Sash in the pre-A/UX 2.0 days) attempts to shut down the Macintosh operating system as much as possible, including closing all drivers, loading A/UX, and starting it running. It does not perform a RESET, so if you have not disabled interrupts in your Close routine, A/UX may get up and running and find itself receiving interrupts for a board about which it knows nothing--a situation which makes it very unhappy.
In summary, A/UX Startup issues a _PBClose call to your driver, so your driver must implement a Close routine and it must accomplish the following (even if you never intend to support your board under A/UX):
* Disable all interrupts for your device.
* Remove your interrupt handler, replacing any changed interrupt vectors.
* Release any private data storage held by your driver.
Further Reference:
NuBus is a trademark of Texas Instruments.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help